<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en">
<head>
    <title>注册</title>
    <meta http-equiv="keywords" content="enter,your,keywords,here"/>
    <meta http-equiv="description"
          content="A short description of this page."/>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>

    <!--<link rel="stylesheet" type="text/css" href="styles.css">-->
</head>
<body>
<ui:composition template="General.xhtml">
    <ui:define name="title">新用户注册 </ui:define>
    <ui:define name="content">
        <h:form>
            <p:outputPanel autoUpdate="true">
                <p:growl/>
            </p:outputPanel>
            <h:panelGrid columns="5">
                <h:outputLink value="ZoneList.jspx" styleClass="topNav1">
                    <h:outputText value="讨论"/>
                </h:outputLink>
                <h:outputText value=">>"/>
                <h:outputText value="注册新用户" styleClass="mark"/>
            </h:panelGrid>
            <p:separator/>
            <p:panel style="width:500px;margin: 0 auto;">
                <h:outputText value="新用户注册" styleClass="headLine"></h:outputText>
                <p:separator/>
                <h:panelGrid columns="2" styleClass="generalInfo" style="vertical-align: middle!important;">
                    <h:outputLabel value="用户名："/>
                    <h:panelGroup>
                        <p:inputText value="#{register.user.username}" style="width:200px;">
                            <p:ajax listener="#{register.onChangeUrn}" update="urnTip" process="@form"/>
                        </p:inputText>
                        <h:outputText id="urnTip" value="&nbsp;#{register.urnTip}"
                                      style="color:#{register.urnOk?'green;':'red;'}}"/>
                    </h:panelGroup>
                    <h:outputLabel value="密码："/>
                    <p:password value="#{register.user.password}" style="width:200px;"/>
                    <h:outputLabel value="密码确认："/>
                    <p:password value="#{register.pwd_re}" style="width:200px;"/>

                    <h:outputLabel value="E-mail："/>
                    <h:panelGroup>
                        <p:inputText value="#{register.user.email}" style="width:200px;">
                            <p:ajax listener="#{register.onChangeEmail}" update="emailTip" process="@form"/>
                        </p:inputText>
                        <h:outputText id="emailTip" value="&nbsp;#{register.emailTip}"
                                      style="color:#{register.emailOk?'green;':'red;'}}"/>
                    </h:panelGroup>
                    <h:outputLabel value="验证码："/>
                    <h:panelGroup>
                        <p:inputText value="#{register.authStr}" style="width:100px"/>
                        <p:commandLink update="auth"
                                       action="#{register.refreshAuth}">
                            <h:graphicImage id="auth" title="点击换一个"
                                            style="border:black 0px solid;vertical-align:bottom;width:100px;height:22px;"
                                            url="/AuthImage?id=#{register.id_temp}"/>
                        </p:commandLink>
                    </h:panelGroup>
                    <h:outputText/>
                    <h:panelGroup>
                        <h:selectBooleanCheckbox value="#{register.accept}" style="vertical-align: bootom">
                            <f:ajax render="reg" execute="@form"/>
                        </h:selectBooleanCheckbox>
                        <h:outputText value="我已阅读并接受"/>
                        <h:outputLink value="#" styleClass="operation">
                            <h:outputText value="《#{applicationBean.siteName}用户协议》"/>
                        </h:outputLink>
                    </h:panelGroup>
                    <p:commandButton id="reg" value="注册" disabled="#{!register.accept}"
                                     action="#{register.reg_ok}"></p:commandButton>
                </h:panelGrid>
            </p:panel>
        </h:form>
    </ui:define>
</ui:composition>
</body>
</html>
